package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class PublicSearch extends JFrame {

	private JPanel contentPane;
	private JTextField countryTextField;
	private JTextField areaTextField;
	private JTextField textField;
	
	

	/**
	 * Create the frame.
	 */
	public PublicSearch() {
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(250, 30, 800, 600);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblCountry = new JLabel("Country:");
		lblCountry.setBounds(80, 64, 61, 16);
		contentPane.add(lblCountry);
		
		JLabel lblArea = new JLabel("Area:");
		lblArea.setBounds(299, 64, 40, 16);
		contentPane.add(lblArea);
		
		JLabel lblTime = new JLabel("Time:");
		lblTime.setBounds(510, 64, 40, 16);
		contentPane.add(lblTime);
		
		countryTextField = new JTextField();
		countryTextField.setBounds(138, 58, 134, 28);
		contentPane.add(countryTextField);
		countryTextField.setColumns(10);
		
		areaTextField = new JTextField();
		areaTextField.setBounds(340, 58, 134, 28);
		contentPane.add(areaTextField);
		areaTextField.setColumns(10);
		
		textField = new JTextField();
		textField.setBounds(548, 58, 52, 28);
		contentPane.add(textField);
		textField.setColumns(10);
		
		JLabel lblChooseTheWanted = new JLabel("Choose the wanted place from the map");
		lblChooseTheWanted.setBounds(41, 125, 262, 16);
		contentPane.add(lblChooseTheWanted);
		
		JLabel lblMap = new JLabel("New label");
		lblMap.setBounds(37, 164, 735, 345);
		contentPane.add(lblMap);
		
		JButton btnCheck = new JButton("Check");
		btnCheck.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				/*	Image image = null;
				
		        try {
		            URL url = new URL("http://www.9ori.com/media/images/4ae0b92e6c.jpg");
		            // http://upload.wikimedia.org/wikipedia/commons/5/54/Path_%282%29_%28archaeological_park_Xanten%2C_Germany%2C_2005-04-23%29.jpg
		            image = ImageIO.read(url);
		        } catch (IOException e) {
		        	e.printStackTrace();
		        }
		        
		        JLabel lblMap = new JLabel(new ImageIcon(image));
				lblMap.setBounds(25, 258, 737, 282);
				getContentPane().add(lblMap);*/
			}
		});
		btnCheck.setBounds(689, 528, 83, 29);
		contentPane.add(btnCheck);
		
		
		
	}
}
